package com.example.demo;

import javax.annotation.Resource;

import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.example.service.UserService;

@Controller
@RestController
public class Demo {
/*	@Resource
	private UserService userService;*/
	
	@RequestMapping("/")  
	public String home() {  
        return "Hello World!";  
    }  
      
    @RequestMapping("/hello/{myName}")  
    String index(@PathVariable String myName) {  
        return "Hello "+myName+"!!!";  
    }
    
    @RequestMapping("/getDemo")  
    @ResponseBody
    public Student getDemo(){
    	Student s =new Student();
    	s.setId(1);
    	s.setName("hah");
    	return s;
    }
}
